package com.vcc.service.client.vo.role;

import com.vcc.data.entity.ClientPermission;
import com.vcc.service.client.vo.baseVo.BaseVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ClientPermissionVo extends BaseVo implements Serializable {

    private String code;

    private String name;

    private Boolean hasParent;

    private Long parentId;

    private Boolean hasClientChecked;

    private List<ClientPermissionVo> children;


    public ClientPermissionVo(ClientPermission clientPermission) {
        this.setId(clientPermission.getId());
        this.setCreateDate(clientPermission.getCreateDate());
        this.setUpdateDate(clientPermission.getUpdateDate());
        this.setCode(clientPermission.getCode());
        this.setName(clientPermission.getName());
        this.setParentId(clientPermission.getParentId());
        this.setHasParent(clientPermission.getHasParent());
        this.hasClientChecked = clientPermission.getHasClientChecked();
    }

}
